Re: [NTG-context] Table of Contents Header?

2021-12-30 Thread kauśika via ntg-context
clabel][toclabel][\TOCLabel] \setupsynonyms[toclabel][textstyle=\sc] \toclabel{TOCNumberLabel}{Chapter} \toclabel{TOCTitleLabel}{Title} \toclabel{TOCPageLabel}{Page} Then compute the width of the chapter-number and page-number labels \setwidthof\TOCLabel{TOCNumbe

Re: [NTG-context] Getting width of text to be typeset

2020-05-23 Thread Rik Kabel
On 5/22/2020 19:49, Rik Kabel wrote: If the OP simply wants the width of a string, one can use \setwidthof#1\to#2. \define\String{pqrs} \setwidthof{\String}\to\Wdth \String\ is \Wdth\ wide. \setwidthof{{\tfb\em\String}}\to\Wdth {\tfb\em\String} is \Wdth\ wide. I do

Re: [NTG-context] Getting width of text to be typeset

2020-05-23 Thread Gerben Wierda
> On 23 May 2020, at 01:49, Rik Kabel wrote: > > If the OP simply wants the width of a string, one can use \setwidthof#1\to#2. > > \define\String{pqrs} > \setwidthof{\String}\to\Wdth > \String\ is \Wdth\ wide. > > \setwidthof{{\tfb\em\String}}\to\Wdth > {

Re: [NTG-context] Getting width of text to be typeset

2020-05-22 Thread Rik Kabel
dozen nodes in a run. Hans If the OP simply wants the width of a string, one can use \setwidthof#1\to#2. \define\String{pqrs} \setwidthof{\String}\to\Wdth \String\ is \Wdth\ wide. \setwidthof{{\tfb\em\String}}\to\Wdth {\tfb\em\String} is \Wdth\ wide. I do not know if that is dif

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel
' of the narrowed paragraph. Also, the placement of the text in the margin is wrong and not easily controlled as with \llap and \rlap. The code started out more like: \define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }} \setwidthof{\Mark}\to\MarkWidth ... \starttexdefinition

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Wolfgang Schuster
and not easily controlled as with \llap and \rlap. The code started out more like: \define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }} \setwidthof{\Mark}\to\MarkWidth ... \starttexdefinition stopBufTest \startluacode buffers.prepend("TestBuffer","\\dontl

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel
and \rlap. The code started out more like: \define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }} \setwidthof{\Mark}\to\MarkWidth ... \starttexdefinition stopBufTest   \startluacode buffers.prepend("TestBuffer","\\dontleavehmode\\llap{\\Mark}"

Re: [NTG-context] Regression with \doboundtext in \writetolist

2015-10-11 Thread Hans Hagen
On 10/11/2015 5:21 AM, Rik Kabel wrote: The following example works with older versions of ConTeXt, such as the version from 20150325 in my repository. It fails with TL15 and later, including the current standalone beta. % macros=mkvi \setwidthof {99}\to\IDWidth\relax \def\STWidth

Re: [NTG-context] Regression with \doboundtext in \writetolist

2015-10-11 Thread Wolfgang Schuster
later, including the current standalone beta. % macros=mkvi \setwidthof {99}\to\IDWidth\relax \def\STWidth{\dimexpr\textwidth-\IDWidth+1cm} \definelist[OList] \setuplist [OList][criterium=all,alternative=c,pagecommand=\gobbleoneargument] \starttexdefinition OLister #ID#

Re: [NTG-context] Regression with \doboundtext in \writetolist

2015-10-11 Thread Rik Kabel
On 2015-10-11 06:11, Hans Hagen wrote: On 10/11/2015 5:21 AM, Rik Kabel wrote: The following example works with older versions of ConTeXt, such as the version from 20150325 in my repository. It fails with TL15 and later, including the current standalone beta. % macros=mkvi \setwidthof

[NTG-context] Regression with \doboundtext in \writetolist

2015-10-10 Thread Rik Kabel
The following example works with older versions of ConTeXt, such as the version from 20150325 in my repository. It fails with TL15 and later, including the current standalone beta. % macros=mkvi \setwidthof {99}\to\IDWidth\relax \def\STWidth{\dimexpr\textwidth-\IDWidth+1cm

Re: [NTG-context] Problem in natural tables with nc= and alignmentcharacter

2014-06-25 Thread Hans Hagen
the width of simple things; from Hans on the mailing %% list http://www.ntg.nl/pipermail/ntg-context/2007/024390.html %% example usage: \SetWidthOf{\ColContent}\to\ColContentWidth\relax %% or: \SetWidthOf{Column Content}\to\ContentWidth\relax \def\SetWidthOf#1\to#2

Re: [NTG-context] Problem in natural tables with nc= and alignmentcharacter

2014-06-24 Thread Rik Kabel
; from Hans on the mailing %% list http://www.ntg.nl/pipermail/ntg-context/2007/024390.html %% example usage: \SetWidthOf{\ColContent}\to\ColContentWidth\relax %% or: \SetWidthOf{Column Content}\to\ContentWidth\relax \def\SetWidthOf#1\to#2% {\bgroup \setbox\scratchbox

Re: [NTG-context] Metafun manual section titles

2011-11-13 Thread Andreas Harder
,boffset=.25ex, frame=off,framecolor=yellow:4, background=head:line] \defineheadplacement [MyPlacement] [vertical] {\setwidthof{#1\hskip\leftmargindistance}\to\MyWidth\hskip-\MyWidth \startframedHead #1\hskip\leftmargindistance #2 \stopframedHead} \setuphead [chapter,section

Re: [NTG-context] measuring alphabet length

2011-06-15 Thread Hans Hagen
be an expandable variant (proper typeset but the string must be utf characters only) \starttext \setwidthof{Robin Kirkham}\to\whatever \whatever=\widthofstring{Robin Kirkham} \stoptext

[NTG-context] Title page layout

2010-05-31 Thread Scott Steele
. It was originally \setwidthof#1\to#2, which—in English at least—sounds somewhat ambiguous with regard to which variable is providing a width. \def\TitlePage#1#2% { \givewidthof{\scc #2}\to\SubtitleWidth \newdimen\TitlePageVar \TitlePageVar=\dimexpr(\textwidth-\SubtitleWidth) \dontleavehmode\vfill

Re: [NTG-context] Using \startalign outside of math mode?

2009-08-28 Thread Matthijs Kooijman
Hi all, foo = bar | baz it seems I found some sort of a solution. Using the \setwidthof I found at [1], I wrote the following: \def\setwidthof#1\to#2% {\bgroup \setbox\scratchbox\hbox{#1}% \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}} foo = bar \setwidthof{foo

Re: [NTG-context] setupsynonym: 2 questions on width

2009-03-05 Thread Wolfgang Schuster
. \definesynonyms[nomenclature][nomenclatures][\infull] \setupsynonyms[nomenclature][criterium=all,width=broad] \nomenclature[a]{a}{This is the letter a} \nomenclature[b]{abcdefghijklmnopqrstuvwxyz}{This is the alphabet} \nomenclature[c]{c}{This is the letter c} \def\setwidthof#1\to#2% {\bgroup \setbox

Re: [NTG-context] setupsynonym: 2 questions on width

2009-03-05 Thread Michael Bynum
Right, that works for this example, but if I change what nomenclatures are in the list then I would have to go in and manually change the setwidthof{} command. Am I correct in thinking that? I guess ideally I wouldn't have to go in and change the spacing manually every time I update my

[NTG-context] horizontal space in \inframed and \hskip

2009-01-14 Thread Michael Green
://archive.contextgarden.net/message/20070314.120612.adab0a8b.en.html \def\setwidthof#1\to#2% {\bgroup \setbox\scratchbox\hbox{#1}% \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}} \setwidthof{{\it Wednesday, January 28.\hskip 1em}}\to\longestdate %% Definitions \def\ClassDate#1{\item \inframed

Re: [NTG-context] Equivalent to \settowidth

2007-03-17 Thread Robin Kirkham
}}, ...] \def\setwidthof#1\to#2% {\bgroup \setbox\scratchbox\hbox{#1}% \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}} Thanks Wolfgang, Chen and Hans for your responses. I used Hans' one ... it seems to work. I'm actually trying to indent tables of contents by level. I want each indent

Re: [NTG-context] Equivalent to \settowidth

2007-03-14 Thread Hans Hagen
\stoptext this will typeset ok, but not with \dimen0=\robinwidth \def\setwidthof#1\to#2% {\bgroup \setbox\scratchbox\hbox{#1}% \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}} \starttext \setwidthof{Robin Kirkham}\to\whatever \getrawparameters [robin] [width=\whatever